#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QtSerialPort/QSerialPort>
#include <QtSerialPort/QSerialPortInfo>
#include <QtGui>
//#include <QMessageBox>

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private slots:          //槽函数
    void on_pushButton_remove_rx_clicked();
    void on_pushButton_remove_tx_clicked();
    void on_pushButton_tx_clicked();
    void on_com_start_toggled(bool checked);
    void receive_data();

private:
    Ui::MainWindow *ui;
    //TODO: serial port instance shall be another *.cpp file as a independent module 
    QSerialPort serial;     //实例QSerialPort对象
};
#endif // MAINWINDOW_H
